home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 483 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. From: howlett@netcom.com (Scott Howlett)
  2. Message-ID: <199602181812.KAA17074@netcom21.netcom.com>
  3. X-Original-Date: Sun, 18 Feb 1996 10:12:14 -0800
  4. Path: in1.uu.net!bounce-back
  5. Date: 19 Feb 96 02:29:16 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: template typedef
  9. References: <jonathan.k.armstrong-1602961624250001@mac-nro.denver.cdev.com>
  10. Organization: (or lack thereof)
  11. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  12.     iQBFAgUBMSfgiOEDnX0m9pzZAQHLggF+Oxh/z69E1ZqYVThDY0Nft4uxYhgXovdu
  13.     1miYNlWtoGeZN6/SlaY4FXbAYRJ1xjWy
  14.     =15Uq
  15.  
  16. jonathan.k.armstrong@cdev.com (J. Karl Armstrong) wrote:
  17.  
  18. > Is there any reason why template typedefs are not allowed? Something like:
  19. > template <class T>
  20. > typedef T *GeneralPointer;
  21. > GeneralPointer<int> iptr;
  22. > Trivial example, I know, but there are reasons I would like this.
  23.  
  24. I would find this convenient as well, but it's easy to get this
  25. functionality in a slightly different way (and perhaps this is the reason
  26. that it isn't supported directly?):
  27.  
  28. template <class T> struct foo {
  29.     typedef T * GeneralPointer;
  30. };
  31.  
  32. foo<T>::GeneralPointer iptr;
  33.  
  34. -- 
  35. Scott Howlett, howlett@netcom.com
  36. "Probably the earliest fly swatters were nothing more than some sort of 
  37. striking surface attached to the end of a long stick."
  38. ---
  39. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  40.   Contact address: std-c++-request@ncar.ucar.edu.  Moderation policy:
  41.   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
  42.